home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_09 / allison / bittest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-10  |  387 b   |  27 lines

  1. #include <iostream.h>
  2. #include "bitstr.h"
  3.  
  4. main()
  5. {
  6.     bitstring b("00110");
  7.  
  8.     cout << "b == " << b << endl;
  9.     for (int i = 0; i < b.length(); ++i)
  10.         cout << "b[" << i << "] == " << b[i] << endl;
  11.  
  12.     b[0] = 1;
  13.     cout << "b == " << b << endl;
  14.     return 0;
  15. }
  16.  
  17. /* Output:
  18. b == 00110
  19. b[0] == 0
  20. b[1] == 0
  21. b[2] == 1
  22. b[3] == 1
  23. b[4] == 0
  24. b == 10110
  25. */
  26.  
  27.